package com.huawei.appmarket.service.externalservice.update;

import android.content.DialogInterface;
import android.content.DialogInterface.OnKeyListener;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import com.huawei.appmarket.R;
import com.huawei.appmarket.framework.activity.SecureActivity;
import o.cks;
import o.cku;
import o.dgh;
import o.Logger;
import o.dss;
import o.eqp;
import o.eua;
import o.NetWorkUtil;
import o.ewb;

public class ThirdUpdateRemindActivity extends SecureActivity {
    private cku ˊॱ;

    static class a implements OnCheckedChangeListener {
        private a() {
        }

        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            eua.ˏ().ˋ("never_reminder_auto_update", z);
        }
    }

    public void onCreate(Bundle bundle) {
        Logger.ˎ("ThirdUpdateRemind", "ThirdUpdateRemindActivity onCreate");
        super.onCreate(bundle);
        getWindow().requestFeature(1);
        ʼ();
    }

    private void ʼ() {
        View inflate = LayoutInflater.from(this).inflate(R.layout.ota_update_remind_dialog, null);
        ((CheckBox) inflate.findViewById(R.id.auto_update_remind_dialog_no_remind_checkbox)).setOnCheckedChangeListener(new a());
        ((TextView) inflate.findViewById(R.id.auto_update_remind_dialog_content)).setText(NetWorkUtil.rebuildWifiKey(getString(R.string.auto_update_remind_dialog_content)));
        View findViewById = inflate.findViewById(R.id.update_auto_warn_layout);
        int ˎ = ewb.ˎ(this);
        findViewById.setPaddingRelative(ˎ, ˎ, ˎ, findViewById.getPaddingBottom());
        this.ˊॱ = cku.ˏ(this, cku.class, null, null);
        this.ˊॱ.ˊ(inflate);
        CharSequence string = getString(R.string.auto_update_remind_dialog_button_confirm);
        CharSequence string2 = getString(R.string.download_dialog_button_cancel);
        this.ˊॱ.ॱ(-1, string);
        this.ˊॱ.ॱ(-2, string2);
        this.ˊॱ.ॱ(new cks(this) {
            final /* synthetic */ ThirdUpdateRemindActivity ˏ;

            {
                this.ˏ = r1;
            }

            public void enableNetworking() {
                this.ˏ.ᐝ();
                dss.ॱ().ˋ(true);
                this.ˏ.finish();
            }

            public void upgrade() {
                this.ˏ.ॱॱ();
                this.ˏ.finish();
            }

            public void ˋ() {
            }
        });
        this.ˊॱ.ˏ(new OnKeyListener(this) {
            final /* synthetic */ ThirdUpdateRemindActivity ˎ;

            {
                this.ˎ = r1;
            }

            public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                if (i != 4) {
                    return false;
                }
                this.ˎ.ॱॱ();
                this.ˎ.finish();
                return true;
            }
        });
        this.ˊॱ.ˎ(this);
    }

    private void ᐝ() {
        dgh.ॱ("130407", "HomeCountry", eqp.ॱ());
    }

    private void ॱॱ() {
        dgh.ॱ("130408", "HomeCountry", eqp.ॱ());
    }

    public void onDestroy() {
        if (this.ˊॱ != null) {
            this.ˊॱ = null;
        }
        super.onDestroy();
    }
}
